<?

if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Product extends CI_Controller {
    
    public function __construct() {
        parent::__construct();
        $this->load->model("product_model");
        $this->load->model("cat_model");
        
        // Category List
        $query_cat = $this->cat_model->getFirstPageData();
        //--- List Of Category
        $this->data['query_cat'] = $query_cat;
    }
    
    public function prddetail($prd_id){
        
        $query= $this->product_model->getProductDetailById($prd_id);
        
        $row = $query->row();
        
        if($row){
            $this->data['PRD_ID'] = $row->PRD_ID;
            $this->data['MEMBER_ID'] = $row->MEMBER_ID;
            $this->data['PRD_CODE'] = $row->PRD_CODE;
            $this->data['PRD_NAME'] = $row->PRD_NAME;
            $this->data['PRD_DESC'] = $row->PRD_DESC;
            $this->data['ENTRY_DATE'] = $row->ENTRY_DATE;
            $this->data['IS_ACTIVE'] = $row->IS_ACTIVE;
            $this->data['BRAND_ID'] = $row->BRAND_ID;
            $this->data['CAT_ID'] = $row->CAT_ID;
            $this->data['SUB_CAT_ID'] = $row->SUB_CAT_ID;
            $this->data['MARKET_PRICE'] = $row->MARKET_PRICE;
            $this->data['SALE_PRICE'] = $row->SALE_PRICE;
            $this->data['PRD_COST'] = $row->PRD_COST;
            $this->data['IS_FEATURED'] = $row->IS_FEATURED;
            $this->data['IS_SALE'] = $row->IS_SALE;
            $this->data['IS_SPECIAL'] = $row->IS_SPECIAL;     
            $this->data['IS_BEST_SELLER'] = $row->IS_BEST_SELLER;
            $this->data['IS_NEW'] = $row->IS_NEW;
            $this->data['PRD_IMG_1'] = $row->PRD_IMG_1;
            $this->data['PRD_IMG_2'] = $row->PRD_IMG_2;
            $this->data['PRD_IMG_3'] = $row->PRD_IMG_3;
            $this->data['PRD_IMG_4'] = $row->PRD_IMG_4;
            $this->data['PRD_IMG_5'] = $row->PRD_IMG_5;
            $this->data['CREATED_DATETIME'] = $row->CREATED_DATETIME;
            $this->data['MODIFIED_DATETIME'] = $row->MODIFIED_DATETIME;           
        } else {
            
        }
        
        $this->load->view('product/product_view', $this->data);
    }
}
?>
